@tool
class_name Guard_CheckSkill
extends Guard

@export var skill_id:CompositeProperty

func is_satisfied(transition:Transition,state:State) -> bool:
	var entity:Entity = state.chart.get_expression_property("Entity") as Entity
	var skill_component:SkillComponent = entity.get_component(SkillComponent)
	if not skill_component:
		return false
	return skill_component.get_skill_agent().check_can_release_skill_by_id(skill_id.get_value(entity))

func _init() -> void:
	if Engine.is_editor_hint():
		resource_local_to_scene = true
